namespace Cos.Core.NHibernate
{
    #region Usings

    using System.Collections.Generic;

    #endregion

    public class RoleDataModel
    {
        #region Constructors and Destructors

        public RoleDataModel() {}

        #endregion

        #region Properties

        public virtual string ApplicationName { get; set; }

        //public virtual IEnumerable<PageGroupAccessDataModel> PageGroupAccesses { get; set; }

        public virtual string Rolename { get; set; }

        //public virtual IEnumerable<UsersInRoleDataModel> UsersInRoles { get; set; }

        #endregion

        #region Object Overrides

        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return false;
            }

            var model = obj as RoleDataModel;

            return model != null && this.Rolename == model.Rolename && this.ApplicationName == model.ApplicationName;
        }

        public override int GetHashCode()
        {
            return this.Rolename.GetHashCode() ^ this.ApplicationName.GetHashCode();
        }

        #endregion
    }
}